package com.dustedpixels.dcel.parser;

import java_cup.runtime.Symbol;
%%
%cup
%%
"package" { return new Symbol(sym.PACKAGE); }
"unit" { return new Symbol(sym.UNIT); }
"config" { return new Symbol(sym.CONFIG); }
"port" { return new Symbol(sym.PORT); }
"component" { return new Symbol(sym.COMPONENT); }
"logic" { return new Symbol(sym.LOGIC); }
"trigger" { return new Symbol(sym.TRIGGER); }
"script" { return new Symbol(sym.SCRIPT); }
";" { return new Symbol(sym.SEMI); }
"+" { return new Symbol(sym.PLUS); }
"-" { return new Symbol(sym.MINUS); }
"<<" { return new Symbol(sym.SHL); }
">>" { return new Symbol(sym.SHR); }
"&" { return new Symbol(sym.AND); }
"|" { return new Symbol(sym.OR); }
"^" { return new Symbol(sym.XOR); }
"~" { return new Symbol(sym.NOT); }
"(" { return new Symbol(sym.LPAREN); }
")" { return new Symbol(sym.RPAREN); }
"{" { return new Symbol(sym.LCURLY); }
"}" { return new Symbol(sym.RCURLY); }
"=" { return new Symbol(sym.ASSIGN); }
"==" { return new Symbol(sym.EQ); }
"!=" { return new Symbol(sym.NEQ); }
"." { return new Symbol(sym.DOT); }
[a-zA-Z_][a-zA-Z0-9_]* { return new Symbol(sym.IDENT, yytext()); }
[0-9]+ { return new Symbol(sym.NUMBER, new Integer(yytext())); }
[ \t\r\n\f] { /* ignore white space. */ }
. { System.err.println("Illegal character: "+yytext()); }
